<template>
	<scroll-view class="content" scroll-y>
		<block>
			<view class="container">

				<view class="flex-row">
					<view class="flex-row1">
						<view class="blue-line"></view>
						<view class="aaaa">{{datas.notice_title}}</view>
					</view>
					<view class="read">已有{{datas.browse_num ? datas.browse_num : 0}}人阅读</view>
				</view>
				<view class="flex-row flex-row2">
					<view class="read">发布人:{{datas.nicheng}}</view>
					<view class="read">发布时间:{{datas.crate_time}}</view>
				</view>
				<!-- <view class="flex-row3">{{datas.notice_text}}</view> -->
				<view class="flex-row3">
					<rich-text @tap="gotowebview(item)" v-for="(item,index) in datas.notice_text" :key="index" :nodes="item"></rich-text>
				</view>

			</view>
		</block>
	</scroll-view>
</template>

<script>
	export default {
		data() {
			return {
				groupid:"",
				mockList: [],
				datas:''
			};
		},
		onNavigationBarButtonTap() {
			uni.switchTab({
				url: '../index/index'
			})
		},
		onLoad:function(e){
			this.datas=JSON.parse(decodeURIComponent(e.data));
			this.datas.notice_text=this.datas.notice_text.replace(/&lt;/g, '<').replace(/&gt;/g, '>');
			var dataarr=[]; 
			var arr=this.datas.notice_text.split('![](');
			arr.forEach((item,key)=>{
				var a=item.split((')![]'));
				dataarr=dataarr.concat(a)
				})
			this.datas.notice_text=dataarr;
			var token = uni.getStorageSync('token');
			this.$zapi.apiPost('user/notice/browseNum', {
				"k_token": token,
				"groupid": this.datas.groupid,
				"notice_id":this.datas.notice_id
			}).then(res => {
			});
		},
		methods:{
			gotowebview:function(item){
				if(item.indexOf('http')==0){
					uni.navigateTo({
						url: 'group_notic_web?url=' + encodeURIComponent(JSON.stringify(item))
					})
				}
				
			}
		}
	}
</script>

<style scoped>
	.aaaa {
		width: 500upx;
		white-space: nowrap;
		overflow: scroll;
		font-size: 34upx;
		color: #333333;
	}
	.content {
		position: absolute;
		height: 100%;
		width: 100%;
		background-color: #FFFFFF;
	}
	
	.container {
		height: auto;
		background-color: #ffffff;
		padding-top: 9upx;
		margin-bottom: 20upx;
	}
	
	.blue-line {
		width: 4upx;
		height: 36upx;
		background: #FF9900;
		margin-right: 20upx;
		min-width: 4upx;
	}
	
	.flex-row {
		width: 710upx;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		margin-bottom: 20upx;
	}
	
	.flex-row1 {
		height: 40upx;
		display: flex;
		flex-direction: row;
		align-items: center;
		margin-left: 20upx;
		margin-top: 10upx;
		font-size: 38upx;
		color: #333333;
	}
	
	.grid_r1_l1_top:after {
		content: "【置顶】";
		display: inline-block;
		font-size: 24upx;
		color: #f10000;
	}
	
	.read {
		font-size: 26upx;
		color: #999999;
	}
	
	.read2 {
		font-size: 26upx;
		color: #999999;
		margin-right: 30upx;
		flex-shrink: 0;
	}
	
	.flex-row2 {
		width: 710upx;
		margin: 0 auto;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		padding-left: 20upx;
		font-size: 22upx;
		color: #999999;
		border-bottom: 1px solid #e5e5e5;
		padding-bottom: 20upx;
	}
	
	.flex-row3 {
		width: 90%;
		height: auto;
		margin-left: 20upx;
		font-size: 33upx;
		color: #666666;
		padding-top: 10upx;
		padding-bottom: 10upx;
		white-space: pre-wrap;
		word-break:break-all;
	}
	view {
		font-size: 32upx;
	}
	.hr {
		height: 10upx;
		background: #FAFAFA;
	}
</style>
